import 'package:flutter/material.dart';
import 'package:flutter_yfree/YFree.dart';

class Views {
  static Widget view_badge(int badge) {
    return badge > 0
        ? Container(
            constraints: BoxConstraints(minWidth: 16),
            decoration: BoxDecoration(color: Colors.redAccent, borderRadius: BorderRadius.circular(99)),
            padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
            alignment: Alignment.center,
            child: Text(badge > 99 ? "99+" : badge.toString(), style: TextStyle(fontSize: 10, color: Colors.white)),
          )
        : YEmpty();
  }
}